import { HttpException, HttpStatus } from '@nestjs/common';

export class BusinessException extends HttpException {
  private readonly errorCode: number;

  constructor(message: string, errorCode: number, statusCode: HttpStatus = HttpStatus.BAD_REQUEST) {
    super(message, statusCode);
    this.errorCode = errorCode;
  }

  getErrorCode(): number {
    return this.errorCode;
  }
}
